﻿using System.ComponentModel.DataAnnotations;
using Dexter.Web.Mvc.Annotations;
using Dexter.Web.Mvc.ViewModel.Resources;

namespace Dexter.Web.Mvc.ViewModel.Backoffice.Binders {
	[PropertiesMustMatch ( "NewPassword" , "ConfirmNewPassword" , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "FieldsMustMatch" )]
	public class PasswordBinder {
		public string Username { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		public string OldPassword { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		public string NewPassword { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		public string ConfirmNewPassword { get; set; }
	}
}